<%--
 *  @Author: Kevinfan
 *  Date:    2010/12/23
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.RelationInfoLinkMan");
  String strModuleName = "COM";
  String privilegeCode = "10340,10341";
  String contextPath = request.getContextPath();
  HashMap userinfo = (HashMap)session.getAttribute("userinfo");
%>
<% //--------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>
<%int LangNums = ConstantProp.multiLangNumber;%>
<html>
<head>
<title>DoctorEdit</title>
<PageFlow:CheckPageFlow pageName="p_zyllinkmanrelationinfo"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/Calendar.js"></script>
<script language="JavaScript">
function page_add()
{
	 if(!checkForm(cform)) return;

  cform.actionname.value = "add";
  cform.target = "_self";
  //isRunning = true;
  __submitData("pageform",true);
}

function page_delete()
{
  if(isNullChecked(cform.deleteids)) 
  {
    alert('<%=message.getMessageDesc("PLEASE_SELECT")%>');
    return;
  }
  if(!confirm('<%= message.getMessageDesc("ARE_YOU_SURE_DEL") %>'))
     return;
  cform.actionname.value = "delete";
  cform.target = "_self";
  //isRunning = true;
  __submitData("pageform",true);
}

function page_allcheckselect(){
	var allcheck = cform.allcheck.checked;
	var alldatafile = document.getElementsByName('deleteids');
	var length = alldatafile.length;
	if(allcheck){
		for(var i = 0 ; i < length;i++){
			alldatafile[i].checked = true;
		}
	}else{
		for(var i = 0 ; i < length;i++){
			alldatafile[i].checked = false;
		}	
	}
}

</script>
</head>
<%
String strDisplayFlag="";
if(request.getParameter("displayflag")!=null)
{
  strDisplayFlag=request.getParameter("displayflag");
}
%>
<iframe name="reloadHandler" style="display:none" ></iframe>
<body style="overflow: auto;">
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td class="summary_top"></td>
  </tr>
</table>
<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0">
	<form id="pageform" name="cform" method="post" action="/oval/Dispatcher" >
  	<input type="hidden" name="pagename" value="p_zyllinkmanrelationinfo">
  	<input type="hidden" name="actionname">
  	<input type="hidden" name="maker" value="1">
  	<input type="hidden" name="doctorid" value="<%=pageContext.getAttribute("doctorid")%>">
		<tr class="deepblue-left"> 
		  	<td width="4%" class="title_center"><input type="checkbox" name="allcheck" class="normalradio" onclick="page_allcheckselect();"></td>
          	<td class="title_center">&nbsp;<%= label.getLabelName("L_Relationship_With_The_Doctor") %><font color="RED">*</font></td>
	  		<td class="title_center">&nbsp;<%= label.getLabelName("L_KinsfolkName") %><font color="RED">*</font></td>
			<td class="title_center">&nbsp;<%= label.getLabelName("L_Birthday2") %></td>
			<td class="title_center">&nbsp;<%= label.getLabelName("L_Birthday1") %></td>
			<td class="title_center">&nbsp;<%= label.getLabelName("L_Hobby") %></td>
			<td class="title_center">&nbsp;<%= label.getLabelName("L_CommemorationDay") %></td>
	  	</tr>
	 	<%
            Vector doctorrelationinfo=(Vector)pageContext.getAttribute("doctorrelationinfo");
            if(doctorrelationinfo==null)
              doctorrelationinfo=new Vector();
            int i=1;
            String strClassType="none";
          %>
          <logic:iterate id="doctorrelationinfoitem" collection="<%= doctorrelationinfo %>" >
          <%
          	HashMap PSMap = (HashMap)pageContext.getAttribute("doctorrelationinfoitem");
            Integer oColIndexLang=new Integer(i);
            if(i%2==0)
              strClassType="td-listrom";
            else
              strClassType="none";
            i++;
          %>
         <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull(strClassType)%>'"  class="<%=JspHelper.filterNull(strClassType)%>"> 
            <td class="td_center"> 
              	<input type="checkbox" name="deleteids" id="deleteids<%=JspHelper.filterNull(i-1)%>" value="<custom:write name="doctorrelationinfoitem" property="doctorrelationid"/>" class="normalradio" />
            </td>
            <td class="td_center"><custom:write name="doctorrelationinfoitem" property="valuename" nbsp="true"/></td>
           	<td class="td_center"><custom:write name="doctorrelationinfoitem" property="relativename" nbsp="true"/></td>
           	<td class="td_center"><custom:write name="doctorrelationinfoitem" property="birthday" nbsp="true"/></td>
           	<td class="td_center"><custom:write name="doctorrelationinfoitem" property="birthdaycn" nbsp="true"/></td>
           	<td class="td_center"><custom:write name="doctorrelationinfoitem" property="interests" nbsp="true"/></td>
           	<td class="td_center"><custom:write name="doctorrelationinfoitem" property="anniversary" nbsp="true"/></td>
          </tr>
          </logic:iterate>
      	  <tr >
         	<td class="title_center">&nbsp;</td>
         	<td class="title_center">
				<custom:selectdic dictType="DocRelationType" property="relationtype" label="L_Kinship"/>
            </td>
            <td class="td_center"><custom:text  property="relativename" command="notnull" label="L_KinsfolkName"/></td>
			<td class="td_center">
			             <custom:text property="birthday" dataType="date" name="doctorinfo" dataFormatName="dateformat" size="20"  label="L_Birthday2" onfocus="c.show(this,'cform.birthday','yyyy-MM-dd')" />
			</td>
			<td class="td_center">
			             <custom:text property="birthdaycn" dataType="date" name="doctorinfo" dataFormatName="dateformat" size="20"  label="L_Birthday1" onfocus="c.show(this,'cform.birthdaycn','yyyy-MM-dd')" />
			</td>
			<td class="td_center"><custom:text  property="interests" label="L_Hobby"/></td>
	  		<td class="td_center">
	  		             <custom:text property="anniversary" dataType="date" name="doctorinfo" dataFormatName="dateformat" size="20"  label="L_CommemorationDay" onfocus="c.show(this,'cform.anniversary','yyyy-MM-dd')" />
       	</td>
       	  </tr>
       </form>
	</table>
	<%if(!(strDisplayFlag).equals("view")){%>
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td class="summary_top"></td>
		</tr>
		<tr>
			<td class="td_center">
				<a onclick="javascript:page_add();"><custom:button type="2" label="L_Add" imgsrc="add.gif" border="0" style="width:60"/></a>
				<a onclick="javascript:page_delete();"><custom:button type="2" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
				<a onclick="__back()"><custom:button type="2" label="L_Back" imgsrc="delete.gif" border="0" style="width:60"/></a>
			</td>
			
		</tr>
	</table>
	<%} %>
</body>
<script>
  var list=document.getElementsByTagName("input");
  m=list.length
  list[m-1].style.display='none';
</script>
</html>